<%--
  Created by IntelliJ IDEA.
  User: 温海杰
  Date: 2020/6/17
  Time: 10:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>  <%--使用文章标题 --%>   </title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/news.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.5.1.min.js"></script>
    <style>
        .footing{
            width: 50%;
            height: 300px;
            margin: 10px auto;
            background-repeat:no-repeat;
            background-image: url("${pageContext.request.contextPath}/images/JMULogo.png");
            background-size: 100% 200px;
        }
    </style>
</head>
<script>
    var id = '${requestScope.get("id")}';
    $(function () {
        var path = '${pageContext.request.contextPath}/news/upload'


        $.post("${pageContext.request.contextPath}/news/getNewsInfo", {id: id}, function (data) {
            var id = data.id;
            var title = data.title;
            var body = data.body;
            var summaryInfo = data.summaryInfo;
            var writer = data.writer;
            var releaseDate = data.releaseDate;


            $('#title').text(title);
            $('#releaseDate').text(releaseDate);
            $('#body').html(body).text()
            $('#summaryInfo').text(summaryInfo);
            $('#writer').text(writer);


        }, "json")

        $("#newsId").val(id);
        //每10秒异步提交

    });

</script>
<body>
    <div class="top">
        <h1 id="title">&nbsp;
        </h1>
    </div>
    <div class="summaryInfo" id="summaryInfo">
    </div>
    <div class="releaseDate" id="releaseDate">
    </div>
    <div class="body" id="body">
    </div>
    <div class="writer" id="writer">
    </div>
    <div class="footing">
    </div>
</body>
</html>
